<%@page import="com.oceansoft.core.common.constant.Constant"%>
<%@page import="com.oceansoft.core.domain.SysUser"%>
<%@page import="com.hui.platform.system.utility.StringUtil"%>
<%@page import="com.oceansoft.core.domain.SysResource"%>
<%@page import="java.util.List"%>
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ include file="/resource/common.jsp"%> 
<%
SysUser user = (SysUser) request.getSession().getAttribute(Constant.LOGIN_USER);
System.out.println("user="+user);
if(null==user)
{
%>
<script type="text/javascript">
    top.location.replace("<c:url value='/profile/login.html'/>");
</script>
<%	
}
List<SysResource> rlist = (List<SysResource>)session.getAttribute("rlist");
//System.out.println(rlist);
%>
 <style>
        .footer {
            width: 100%;
            text-align: center;
            line-height: 35px;
             background-color: #d8e4fe;
        }
 
        .top-bg {
            background-color: #d8e4fe;
            height: 72px;
        }
 
    </style>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
    <%--后台管理首页 --%> 
    <title>${title}</title>
	<meta http-equiv="pragma" content="no-cache"/>
	<meta http-equiv="cache-control" content="no-cache"/>
	<meta http-equiv="expires" content="0"/>   
	<script type="text/javascript" src="<c:url value='/resource/js/view/admin_main.js'/>"></script>
	
<!--[if IE 6]>
<script src="<c:url value='/resource/js/DD_belatedPNG.js'/>"></script>
<script>
  DD_belatedPNG.fix('#top');
 // DD_belatedPNG.fix('.active');
 // DD_belatedPNG.fix('.inactive');
 // DD_belatedPNG.fix('.icon_1000024');
 // DD_belatedPNG.fix('.icon_1000025');
</script>
<![endif]-->
	 
<style>
body{ margin:0px; padding:0px; font:12px Verdana, Geneva, sans-serif;}
img{ border:0px;}
.header{ width:100%; height:71px; background:url(<c:url value='/resource/images/index_top_logo.gif'/>) left top no-repeat; background-color:#1a5aa0;}
.h_right{ width:392px; height:71px; float:right; color:#FFF;}
.h_right_l{ width:230px; height:51px; float:left; background-color:#487bb3; padding:10px 10px; line-height:25px;}
#webjx{width:100%;height:25px; line-height:25px; }
.h_right_r{ width:71px; height:71px; float:left;}
.h_right_r a{ display:block; width:71px; height:71px; }
.h_r_password{ background:url(<c:url value='/resource/images/zx_icon_password.gif'/>) 0 0 no-repeat;}
.h_r_close{ background:url(<c:url value='/resource/images/zx_icon_close.gif'/>) 0 0 no-repeat;}
.h_r_password:hover{ background:url(<c:url value='/resource/images/zx_icon_password_a.gif'/>) 0 0 no-repeat;}
.h_r_close:hover{ background:url(<c:url value='/resource/images/zx_icon_close_a.gif'/>) 0 0 no-repeat;}
</style>
	<script type="text/javascript">
		
	var ROOT_PATH = "<%=basePath%>";
	
	function exitSys(){
		$.messager.confirm("注销","是否确认退出系统？",function (r){
			if(r)
			{
				window.location.href="<c:url value='/profile/exit.html'/>";
			}
		})
		return ;
		
		art.dialog.confirm("是否确认退出系统？",function(){
			window.location.href="<c:url value='/profile/exit.html'/>";
		});
	}
	
	/**
	 * 修改密码
	 */
	function changePassword() {
		
		var url = parent.formateUrl("profile/gotochangepwd.html");
		var options = {
				w:400,h:225,title:"修改密码",fn:'submitForm',id:"ps"
		}
		showWin(url,options);
		return;
		
		var url = "gotochangepwd.html";
		art.dialog.open(url, {
			title : "修改密码",
			lock : true,
			width : 385,
			height : 155,
			fixed : true,
			resize : false,
			ok : function() {
				var iframe = this.iframe.contentWindow;
				if (!iframe.document.body) {
					art.dialog.tips("正在加载，请稍候...", 1500);
					return false;
				}
				iframe.submitForm();
				return false;
			},
			cancel : true
		});
	}
	
	function sessionTimeout(){
		window.location.href="<c:url value='/profile/exit.html'/>";
	}
	
	
	function test()
	{
		mask();
		
		$("#loadMsg").html("保存成功"+'&nbsp;&nbsp;&nbsp;&nbsp;');
	}
	
	$(function() {
		// 界面初始化
		
		$("#loading").css({
			"height" :  $(window).height()
		});
		$("#loadMsg").css({
			"left" :  $(window).width()/2 - 80,
			"top":$(window).height()/2 - 80
		});
		
	});
	
	
	</script>

	
	</head>
	<body class="easyui-layout">
    <div region="north" border="true" split="false" style="overflow: hidden; height: 72px;">
     <div class="top-bg">
<div class="h_right">
<div class="h_right_l">用户：${_SESSION_LOGIN_USER.name}
<div id="webjx"></div>
   <script>setInterval("webjx.innerHTML=new Date().toLocaleString()+' 星期'+'日一二三四五六'.charAt(new Date().getDay());",1000);
   </script>
</div>
<div class="h_right_r"><a href="javascript:changePassword()" class="h_r_password"></a></div>
<div class="h_right_r"><a href="javascript:exitSys();" class="h_r_close"></a></div>
</div>
</div>
    </div>
    <div region="south" border="true" split="false" style="overflow: hidden; height: 30px;">
        <div class="footer">版权所有：江苏欧索软件有限公司</div>
    </div>
    <div region="west" split="false" title="导航菜单" style="width: 200px;overflow: hidden;">
    
    
    		<div region="west" class="easyui-accordion" split="true" title="导航菜单" style="width: 200px;">
 
        
        
            <%
                if(null!=rlist)
                {
            	for(int i=0;i<rlist.size();i++)
            	{
					SysResource s = rlist.get(i);
     				int deep = s.getDeep();
     			    //System.out.println(deep+"a");
     				String url_ = s.getUrl();
     				String parentId = s.getParent_id();
     				if(StringUtil.isNull(url_))
     				{
     					url_ = "";
     				}
     				else
     				{
     					url_ = path +"/"+url_;
     				}
     				
     				
     				if(1==deep)
     				{
     					%>
     					 <div title="<%=s.getName()%>" id="m_<%=s.getDbid()%>" data-options="iconCls:'icon-reload'" style="overflow: auto; padding: 10px;">
     					 	 <ul class="easyui-tree" id="m_2_<%=s.getDbid()%>">
                   			 </ul>
     					 </div>
     					 <%
     				}
     				else if(2==deep)
     				{
     					%>
    					 <script type="">
								
								var p = $('#m_2_<%=parentId%>');
								var s =  "<li id='m_3_<%=s.getDbid()%>'><span ><a id='<%=s.getDbid()%>' target='f_<%=s.getDbid()%>' href='<%=url_%>' ><%=s.getName()%></a></span></li>";	
								p.append(s);
						</script>


    					 <%
     				}
     				else if(3==deep)
     				{
     					%>
    					 <script type="">
								var p = $('#m_3_<%=parentId%>');
								var s = "<ul><li><span><a target='f_<%=s.getDbid()%>' id='<%=s.getDbid()%>' href='<%=url_%>'><%=s.getName()%></a></span></li></ul>";
								p.append(s);
	
						 </script>


    					 <%
     				}
            	}
                }
            %>
        
    </div>
    
    </div>
    <div id="mainPanle" region="center" style="overflow: hidden;">
	    <div id="tabs" class="easyui-tabs" fit="true" border="false" >
	            <div title="欢迎使用" style="padding: 20px; overflow: hidden;" id="home">
	                <h1>欢迎使用公安执法告知短信平台!</h1>
	            </div>
	        </div>
    </div>
    
    
    <div id="windiv1" style=""></div>
    <div id="windiv2" style="display: none"></div>
    <div id="windiv3" style="display: none"></div>
    
    <div id='loading' style='display:none; z-index:9999;position:absolute;left:0;width:100%;top:0;background:#E0ECFF;opacity:0.8;filter:alpha(opacity=80);'> 
 <div id='loadMsg' style='position:absolute;  cursor1:wait;width:auto;height:34px;padding:8px 5px 0px 34px;
 background:#fff url(<%=request.getContextPath()%>/resource/images/loading.gif) no-repeat scroll 2px 2px 0px 0px;border:2px solid #ccc;color:#000;'>  
 正在加载，请等待... 
 </div>
 </div>
</body>
</html>
